package net.esj.basic.core.engine.factory.bean;

import java.util.Map;

import javax.inject.Inject;

public class BeanFactoryContextUtils {

	private static BeanFactory beanFactory;

	@Inject
	public void setBeanFactory(BeanFactory beanFactory) {
		BeanFactoryContextUtils.beanFactory = beanFactory;
	}

	public static Object getBean(String name) {
		return beanFactory.getBean(name);
	}

	public static Object getBean(String name, Object... args) {
		return beanFactory.getBean(name, args);
	}

	public static <T> Map<String, T> getBeansByType(Class<T> clazz) {
		return beanFactory.getBeansByType(clazz);
	}

	public static <T> T getBean(Class<T> clazz) {
		return beanFactory.getBean(clazz);
	}
	
}
